package team.pwy.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import team.pwy.pojo.entity.Coupon;

/**
 * 本来用来演示:
 *
 * @author feng
 * @date 2023/10/24
 * @Description
 */
@Repository
public interface CouponMapper {
    @Update("update pwy.pwy_coupon set status = #{status} where id = #{couponId};")
    Integer updateByCouponId(@Param("status") Integer status, @Param("couponId") Integer couponId);

    @Delete("delete  from pwy.pwy_coupon where id=#{value}")
    Integer delById(Integer id);

    @Select("select * from pwy.pwy_coupon where id = #{value}")
    Coupon findByCouponId(Integer couponId);

}
